<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户信息管理 - 用户地址数据系统</title>
    <link rel="stylesheet" href="relation-styles.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <script src="frame-integration.js"></script>
    <style>
        .user-card {
            background: white;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }

        .user-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .user-avatar {
            width: 50px;
            height: 50px;
            border-radius: 25px;
            background-color: #e3f2fd;
            color: #1976d2;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            font-weight: 500;
        }

        .user-name {
            font-size: 18px;
            font-weight: 500;
            color: #2c3e50;
        }

        .user-meta {
            color: #666;
            font-size: 14px;
        }

        .user-actions {
            display: flex;
            gap: 10px;
        }

        .user-details {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-top: 15px;
        }

        .detail-item {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .detail-label {
            color: #666;
            font-size: 13px;
        }

        .detail-value {
            color: #2c3e50;
            font-weight: 500;
        }

        .address-link {
            color: #1976d2;
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .address-link:hover {
            text-decoration: underline;
        }

        .filter-section {
            background: white;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }

        .filter-row {
            display: flex;
            gap: 20px;
            margin-bottom: 20px;
        }

        .filter-item {
            flex: 1;
        }
    </style>
</head>
<body>
    <div class="container">
        <header>
            <div class="title-section">
                <h1>用户信息管理</h1>
                <p class="subtitle">管理地址关联的用户信息</p>
            </div>
            <button class="btn btn-primary" onclick="goToCreateUser()">
                <i class="fas fa-plus"></i> 新增用户
            </button>
        </header>

        <div class="filter-section">
            <div class="filter-row">
                <div class="filter-item">
                    <label class="form-label">关键字搜索</label>
                    <input type="text" class="form-control" placeholder="搜索姓名、证件号、手机号..." id="searchInput">
                </div>
                <div class="filter-item">
                    <label class="form-label">证件类型</label>
                    <select class="form-control" id="idTypeFilter">
                        <option value="">全部</option>
                        <option value="身份证">身份证</option>
                        <option value="护照">护照</option>
                        <option value="军官证">军官证</option>
                    </select>
                </div>
                <div class="filter-item">
                    <label class="form-label">所属区域</label>
                    <select class="form-control" id="districtFilter">
                        <option value="">全部</option>
                        <option value="历下区">历下区</option>
                        <option value="市中区">市中区</option>
                        <option value="槐荫区">槐荫区</option>
                    </select>
                </div>
            </div>
            <div class="form-buttons">
                <button class="btn btn-primary" onclick="searchUsers()">
                    <i class="fas fa-search"></i> 搜索
                </button>
                <button class="btn btn-default" onclick="resetFilters()">
                    <i class="fas fa-redo"></i> 重置
                </button>
            </div>
        </div>

        <div class="user-list">
            <!-- 用户卡片示例 -->
            <div class="user-card">
                <div class="user-header">
                    <div class="user-info">
                        <div class="user-avatar">张</div>
                        <div>
                            <div class="user-name">张三</div>
                            <div class="user-meta">身份证：110********1234</div>
                        </div>
                    </div>
                    <div class="user-actions">
                        <button class="btn btn-default" onclick="viewUserDetail(1)">
                            <i class="fas fa-eye"></i> 查看
                        </button>
                        <button class="btn btn-primary" onclick="editUser(1)">
                            <i class="fas fa-edit"></i> 编辑
                        </button>
                    </div>
                </div>
                <div class="user-details">
                    <div class="detail-item">
                        <div class="detail-label">联系电话</div>
                        <div class="detail-value">138****5678</div>
                    </div>
                    <div class="detail-item">
                        <div class="detail-label">关联地址</div>
                        <a href="#" class="address-link" onclick="viewAddressDetail(1); return false;">
                            <i class="fas fa-map-marker-alt"></i>
                            历下区泉城路街道泉城社区恒大名都8号楼
                        </a>
                    </div>
                    <div class="detail-item">
                        <div class="detail-label">房屋性质</div>
                        <div class="detail-value">商品房</div>
                    </div>
                    <div class="detail-item">
                        <div class="detail-label">入住时间</div>
                        <div class="detail-value">2020-08-15</div>
                    </div>
                </div>
            </div>

            <!-- 更多用户卡片 -->
            <div class="user-card">
                <div class="user-header">
                    <div class="user-info">
                        <div class="user-avatar">李</div>
                        <div>
                            <div class="user-name">李四</div>
                            <div class="user-meta">身份证：220********5678</div>
                        </div>
                    </div>
                    <div class="user-actions">
                        <button class="btn btn-default" onclick="viewUserDetail(2)">
                            <i class="fas fa-eye"></i> 查看
                        </button>
                        <button class="btn btn-primary" onclick="editUser(2)">
                            <i class="fas fa-edit"></i> 编辑
                        </button>
                    </div>
                </div>
                <div class="user-details">
                    <div class="detail-item">
                        <div class="detail-label">联系电话</div>
                        <div class="detail-value">139****1234</div>
                    </div>
                    <div class="detail-item">
                        <div class="detail-label">关联地址</div>
                        <a href="#" class="address-link" onclick="viewAddressDetail(2); return false;">
                            <i class="fas fa-map-marker-alt"></i>
                            市中区大明湖街道大明湖社区12栋
                        </a>
                    </div>
                    <div class="detail-item">
                        <div class="detail-label">房屋性质</div>
                        <div class="detail-value">租房</div>
                    </div>
                    <div class="detail-item">
                        <div class="detail-label">入住时间</div>
                        <div class="detail-value">2023-01-10</div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 分页控件 -->
        <div class="pagination">
            <button class="page-btn" disabled><i class="fas fa-chevron-left"></i></button>
            <button class="page-btn active">1</button>
            <button class="page-btn">2</button>
            <button class="page-btn">3</button>
            <button class="page-btn"><i class="fas fa-chevron-right"></i></button>
        </div>
    </div>

    <script>
        // 添加页面跳转相关函数
        function goToCreateUser() {
            window.location.href = 'user-detail.html?mode=create';
        }

        function viewUserDetail(userId) {
            window.location.href = `user-detail.html?id=${userId}`;
        }

        function editUser(userId) {
            window.location.href = `user-detail.html?id=${userId}&mode=edit`;
        }

        function viewAddressDetail(addressId) {
            window.location.href = `address-detail.html?id=${addressId}`;
        }

        function searchUsers() {
            const keyword = document.getElementById('searchInput').value;
            const idType = document.getElementById('idTypeFilter').value;
            const district = document.getElementById('districtFilter').value;
            
            // 实现搜索逻辑
            console.log('搜索条件:', { keyword, idType, district });
        }

        function resetFilters() {
            document.getElementById('searchInput').value = '';
            document.getElementById('idTypeFilter').value = '';
            document.getElementById('districtFilter').value = '';
        }
    </script>
</body>
</html> 